package com.haha.community.util;

import com.haha.community.entity.User;
import org.springframework.stereotype.Component;

@Component
public class HostHolder {
    private ThreadLocal<User> local = new ThreadLocal<>();

    public  void set(User user){
       local.set(user);
    }
    public User get(){
        return local.get();
    }
    public void clear(){
        local.remove();
    }

}
